<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/default/easyui.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/icon.css"/>">
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery-1.6.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.panel.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.datagrid.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.messager.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/ext-for-framework.js.jsp"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/locale/easyui-lang-zh_CN.js"/>"></script>
<script type="text/javascript">
    var editIndex = undefined;

	function initList(listDisplayEId) {
		$('#' + listDisplayEId).datagrid(
				{
					nowrap : false,
					striped : true,
					collapsible : true,
					remoteSort : true,
					notSelectByRow : false,
					/* frozenColumns : [ [ {
						field : 'ids',
						checkbox : true
					} ] ], */
					toolbar : [
							 ],
					onLoadError : function() {
						$.messager.alert('错误', '获取数据失败，请与管理员联系！', 'error');
					},
					onClickRow : onClickRow
				});

	};
	$(document).ready(function() {
		initList('listDisplay');
	});
	function formatRadio(value,rowData,rowIndex){
		return value="<input type='radio' class='myrad'  name='radioRole' />";
	}
	//角色状态展示0：有效；1为失效
	function formatDGStateField(value,row,index,field){
		if(!field){
			field = this.field;
		}
		var fields = field.split('.');
		var fieldValue = row;
		for(var i=0;i < fields.length;i++){
			if(fieldValue[fields[i]]==0){
			 fieldValue = "有效";
			}else if(fieldValue[fields[i]]==1){
				 fieldValue = "失效";
		    } 
		}
		return fieldValue;
	}
	function  goDetailedContent(val,row){
		return '<a href="#" onclick="constructionManager(\'' + row.id+ '\')">'+val+'</a>  '
	}
	
	function onClickRow(index){
		if (editIndex != index){
			if (endEditing()){
				$('#listDisplay').datagrid('selectRow', index)
						.datagrid('beginEdit', index);
				editIndex = index;
			} else {
				$('#listDisplay').datagrid('selectRow', editIndex);
			}
		}
	}
	function endEditing(){
		if (editIndex == undefined){return true}
		if ($('#listDisplay').datagrid('validateRow', editIndex)){
			var ed = $('#listDisplay').datagrid('getEditor', {index:editIndex,field:'level'});
			var levelname = $(ed.target).combobox('getText');
			$('#listDisplay').datagrid('getRows')[editIndex]['levelname'] = levelname;
			$('#listDisplay').datagrid('endEdit', editIndex);
			editIndex = undefined;
			return true;
		} else {
			return false;
		}
	}
</script>
</head>
<!-- 
        页面详细说明
        审核页面 和店长的我的菜品订单页面  点击详细信息   如果 是采购 菜品则跳转此页面
 -->
<body>
    <form id="AddFoodForm" name="AddFoodForm" method="post">
		<table cellpadding="5">
			      <tr>
                    <td>
				        <input class="easyui-validatebox" type="hidden" name="ordId" required="true" validType="length[1,30]" value="${ordId }"/>
 			        </td>
                  </tr>
        </table>
    </form>

	<table id="listDisplay" title="详细菜品列表" singleSelect=true
		iconCls="icon-list" idField="ordMaterId"
		url="<c:url value="/order/findSelectFoodDetailed.do?oid=${ordId }"/>"
		style="width: 800px; width: 1180px;" loadMsg="请稍候......"
		pagination="true" pageSize="10"
		pageList="[10,20,30,40,50,100,150,200]" sortName="roleId"
		rownumbers="true" sortOrder="asc">
		<thead>
				<tr>
				    <th field="id" width="25" align="center"  checkbox="true">
					</th> 
				    <th field="ordId" width="80"  sortable="true" >
						订单ID
					</th>	
					<th field="ordFoodId" width="80" sortable="true" >
						菜品id
					</th>
					<th field="ordFoodName" width="80" sortable="true" >
						菜品名
					</th>
 					<th field="ordFoodNum" width="80" sortable="true" >
						采购份数
					</th>	
					<th field="ordFoodValue" width="80" sortable="true" >
						总价格
					</th>
 				</tr>
		</thead>
	</table>
</body>
</html>